package com.hyb.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hyb.Vo.SaleStaffVo;
import com.hyb.entity.Sale;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hyb.page.VoQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  销售机会Mapper 接口
 * </p>
 *
 * @author hyb
 * @since 2021-12-29
 */
@Mapper
public interface SaleMapper extends BaseMapper<Sale> {

    IPage<Sale> selectAllSales(Page page,@Param("voQuery") VoQuery voQuery);

    SaleStaffVo selectSaleStaffBySaleId(Integer saleId);

    void assignAccountManager(@Param("sale") Sale sale);

    IPage<Sale> selectSalesByAccountManagers(Page page,@Param("voQuery") VoQuery voQuery);

    IPage<SaleStaffVo> selectAllAssignedSales(Page page);

    IPage<SaleStaffVo> selectAllAssignedSalesByAccountManager(Page page,@Param("staffId") Integer staffId);

    void updateSaleOfTermination(@Param("saleId") Integer saleId);


    void updateSaleOfComplete(@Param("saleId") Integer saleId);
}
